/**
 * @param {number[]} nums
 * @return {number}
 */
 var firstMissingPositive = function(nums) {
    function turn_obj(Array) {
        var obj = {}
       for(var n = 1;n<Array.length+2;n++){
           obj[n] ="a";
       }
       console.log(obj);
       for(var m = 0;m<Array.length;m++){
           obj[Array[m]] = Array[m];
           
       }
       console.log(obj);
       return obj;
   }
   var obj = turn_obj(nums);
   
   for(var i=0;i<nums.length+2;i++){
      if(obj[i] =="a"){
          break;
      }
   }
   return i;


};
    // firstMissingPositive([1,2,0]);
    console.log(firstMissingPositive([1]));